/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019.
 * Description: header for idump mm extend
 * Author: nixiaoming
 * Create: 2017-6-18
 */

#ifndef _LINUX_IDUMP_MM_EXTEND_H_
#define _LINUX_IDUMP_MM_EXTEND_H_

#ifdef CONFIG_RTOS_IDUMP_FORCE
/*
 * 64 signal masking is supported
 * for force dumping of the core
 */
#define IDUMP_SIG_NR 64
#endif

struct idump_mm_extend {
	unsigned int stacksize;
	unsigned int dump_filter_type;

	/* the information about .got and .dynamic sections in the elf file */
	struct idump_elf_info_struct {
		unsigned long dyn_vaddr;
		unsigned long dyn_size;
		unsigned long got_vaddr;
		unsigned long got_size;
	} elf_info;

#if defined(CONFIG_RTOS_IDUMP_FORCE) || defined(CONFIG_RTOS_IDUMP_TRIGGER)
	unsigned long timeout_msec;
	struct core_state *core_state; /* idumping support */
#endif
#ifdef CONFIG_RTOS_IDUMP_FORCE
	/* Declare 64bit signal mask for 32 bit machine */
	DECLARE_BITMAP(sig_force, IDUMP_SIG_NR);
#endif
};

extern void init_idump_mm_extend(struct idump_mm_extend *idump);

#endif
